const fs = require('fs')

const ws = fs.createWriteStream('./test.txt')

ws.write('3\r\n')
ws.write('2\r\n')
ws.write('1\r\n')

ws.close()
